local function lsp()
	local icon = [[  LSP: ]]
	local msg = "No Active LSP"
	local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
	local clients = vim.lsp.get_active_clients()
	if next(clients) == nil then
		return icon .. msg
	end
	for _, client in ipairs(clients) do
		local filetypes = client.config.filetypes
		if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
			return icon .. client.name
		end
	end
	return icon .. msg
end
local function hello()
  return vim.loop.cwd() 
end
local function add_hl(kind, name)
  return "%#NavicIcons"
    .. "#"
    .. kind
    .. "%*%#NavicText#"
    .. name
    .. "%*"
end
local defaulticon= "󰉋"
local status_ok,navic = pcall(require,"nvim-navic")
require("lualine").setup({
  sections = {
    lualine_c = {
      { hello },
      { "filename" },
      "navic",

      -- Component specific options
      color_correction = nil, -- Can be nil, "static" or "dynamic". This option is useful only when you have highlights enabled.
      -- Many colorschemes don't define same backgroud for nvim-navic as their lualine statusline backgroud.
      -- Setting it to "static" will perform a adjustment once when the component is being setup. This should
      --	 be enough when the lualine section isn't changing colors based on the mode.
      -- Setting it to "dynamic" will keep updating the highlights according to the current modes colors for
      --	 the current section.

      navic_opts = nil  -- lua table with same format as setup's option. All options except "lsp" options take effect when set here.
    }
  },
  winbar = {
    lualine_c = {
      {
        function()
          local n = navic.get_location()
          if n=="" then 
            local File = defaulticon.." "
            local fn = vim.api.nvim_buf_get_name(0)
            -- local fn =hello().." > "..string.gsub(vim.api.nvim_buf_get_name(0), vim.loop.cwd(), '')
            return add_hl(File,fn)
          end
          -- print(n)
          return n
        end,
        cond = function()
          local rc = navic.is_available()
          return rc
        end
      },
    }
  }
})
local status_ok, winbar= pcall(require, "winbar")
if status_ok then
  winbar.setup{}
end
vim.opt.laststatus = 3
vim.api.nvim_set_hl(0, "NavicText",               {default = true, bg = "#000000", fg = "#FFA500"})

